# -*- coding: UTF-8 -*-
import os
fileall=[]
dirpath='e:\\baofengdownload'
all=os.walk(dirpath)
for each in all:
    for each2 in each[2]:
        if each2.find('.mp4')!=-1:
            fileall.append(each[0]+os.sep+each2+'\n')
        if each2.find('.rmvb')!=-1:
            fileall.append(each[0]+os.sep+each2+'\n')
        if each2.find('.avi')!=-1:
            fileall.append(each[0]+os.sep+each2+'\n')
writefile=open(dirpath+os.sep+'vediolist.txt','w',encoding='utf-8')
writefile.writelines(fileall)
writefile.close()
